﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAnalyticsTools.Models
{
    /// <summary>
    /// 变化点信息
    /// </summary>
    public class ChangePoint
    {
        /// <summary>
        /// 变化点索引
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 变化点得分
        /// </summary>
        public float Score { get; set; }

        /// <summary>
        /// 变化类型
        /// </summary>
        public TrendDirection ChangeType { get; set; }

        /// <summary>
        /// 变化幅度
        /// </summary>
        public float Magnitude { get; set; }

        /// <summary>
        /// 置信度
        /// </summary>
        public float Confidence { get; set; }

        public string ConfidenceLabel
        {
            get
            {
                if (Confidence >= 0.8f)
                {
                    return "高";
                }
                else if (Confidence >= 0.65f)
                {
                    return "中";
                }
                else
                {
                    return "低";
                }
            }
        }

        public ChangePoint(int index, float score, TrendDirection changeType, float magnitude, float confidence)
        {
            Index = index;
            Score = score;
            ChangeType = changeType;
            Magnitude = magnitude;
            Confidence = confidence;
        }
    }
}
